#include "list.h"
#include <stdio.h>



int 
main(void)
{
	list            p = create();
	int             i;
	for (i = 1; i <= 5; i++)
		push(p, i, i);
	list            cp = copy(p, 1, 4);
	print(p);
	//printf("Copied 4 first nodes of the list\n");
	//push(cp, 1, 1);
	for (i = 1; i <= 3; i++)
		push(cp, 1, i);
	print(cp);
	push(p, size(p), 3);
	printf("Pushed 3 at the %d place\n", size(p) - 1);
	print(p);
	pop_last(p);
	printf("Poped the last element from the list\n");
	print(p);
	printf("3 appears in the list %d times\n", count(p, 3));
	remove_data(p, 3);
	printf("Removed from the list element 3\n");
	reverse(p);
	printf("List reversed\n");
	print(p);
	printf("3 appears in the list %d times\n", count(p, 3));
	printf("Type an element to search in the list\n");
	scanf("%d", &i);
	printf("Element %d appears in the list in the %d node\n", i, search(p, i));
	print(p);
	print(cp);
	merge(p, cp);
	printf("The lists merged\n");
	print(p);
	reverse(p);
	printf("List reversed\n");
	print(p);
	clear(p);
	printf("list cleared\n");
	printf("pushed 5 times 2 in the list\n");
	for (i = 0; i < 5; i++)
		push(p, 1, 2);
	print(p);
	fill(p, 0);
	printf("the list filled with 0 \n");
	print(p);
	unique(p);
	printf("removed the 0 from the list\n");
	print(p);
	return 0;
}
